import Vue from 'vue'
import App from './App.vue'
import demo from './demo.vue'
import {router, beforeEach} from './router'
import store from './store'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import {ajax, api} from './http'
import {IEVersion} from './utils'

Vue.use(ElementUI)

Vue.config.productionTip = false
Vue.prototype.$http = ajax
Vue.prototype.$api = api

// 前置守卫
beforeEach()

//  判断IE版本
let v = IEVersion();
if(v === 11 || v === -1){
  new Vue({
    router,
    store,
    render: h => h(App)
  }).$mount('#app')
}else{
  document.getElementById('app').innerHTML = `
    <h1>请更新您的IE浏览版本，或使用 Google Chrome 浏览器</h1>
    <a href="https://www.google.cn/intl/zh-CN/chrome/">点击下载GoogleChrome</a>
  `
}


